package factory;

public class Test {
    public static void main(String[] args) {
        // 将DataRepository类添加到容器中
        SimpleContainer.addBean(DataRepository.class);

        // 将MyService类添加到容器中
        SimpleContainer.addBean(service.class);

        // 从容器获取MyService对象
        service myService = SimpleContainer.getBean(service.class);

        // 调用MyService对象的方法进行数据保存和获取操作
        String dataKey = "testData";
        Object testData = "This is a test data";

        myService.setDataRepository(dataKey, testData);

        Object retrievedData = myService.getDataRepository(dataKey);
        System.out.println("Retrieved data: " + retrievedData);


    }
}
